﻿using Dapper;
using System;
using BCEntity.MakeStaticPagingComponent.PageTemplateAttachment;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.MakeStaticPagingComponent.PageTemplateAttachment
{
    /// <summary>
    /// 页面模板附件
    /// </summary>
    public interface IPageTemplateAttachmentData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="pageTemplateAttachmentId">页面模板附件Id</param>
        Task<bool> Exists(int pageTemplateAttachmentId);
        /// <summary>
        /// 增加页面模板附件
        /// </summary>
        /// <param name="entity">页面模板附件信息</param>
        Task<PageTemplateAttachmentEntity> Add(PageTemplateAttachmentEntity entity);
        /// <summary>
        /// 更新页面模板附件
        /// </summary>
        /// <param name="entity">页面模板附件信息</param>
        Task<PageTemplateAttachmentEntity> Update(PageTemplateAttachmentEntity entity);
        /// <summary>
        /// 删除页面模板附件
        /// </summary>
        /// <param name="pageTemplateAttachmentId">页面模板附件Id</param>
        Task<bool> Delete(int pageTemplateAttachmentId);
        /// <summary>
        /// 获取页面模板附件
        /// </summary>
        /// <param name="pageTemplateAttachmentId">页面模板附件Id</param>
        Task<PageTemplateAttachmentEntity> GetEntity(int pageTemplateAttachmentId);
        /// <summary>
        /// 获取页面模板附件列表
        /// </summary>
        /// <param name="pageTemplateId">页面模板Id</param>
        Task<IEnumerable<PageTemplateAttachmentEntity>> GetList(long pageTemplateId);
        /// <summary>
        /// 获取页面模板附件分页列表
        /// </summary>
        /// <param name="pageTemplateId">页面模板Id</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        Task<(IEnumerable<PageTemplateAttachmentEntity>, int)> Query(long pageTemplateId,DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
    }


}